'''
Created on Mar 2, 2014

@author: chunhuiluo
'''
from rest_framework import viewsets
from module.models import Module
from store.models import TinyShop, Order, Product,GoodsCategory,GoodsLib
from api.serializers import ModuleSerializer, TinyShopSerializer,\
    OrderSerializer, ProductSerializer,GoodsCategorySerializer


class ModuleViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = Module.objects.all()
    serializer_class = ModuleSerializer
    
    
class TinyShopViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = TinyShop.objects.all()
    serializer_class = TinyShopSerializer


# class UserViewSet(viewsets.ModelViewSet):
#     """
#     API endpoint that allows users to be viewed or edited.
#     """
#     queryset = User.objects.all()
#     serializer_class = UserSerializer


class OrderViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = Order.objects.all()
    serializer_class = OrderSerializer


class ProductViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = Product.objects.all()
    serializer_class = ProductSerializer

class GoodsCategoryViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = GoodsCategory.objects.all()
    serializer_class = GoodsCategorySerializer